<style>
    .show{display: inherit}
    .hide{display: none}
    table tr td,table tr th{width: 5%}
    .layui-btn{margin-right: 10px}

    .layui-table-cell {overflow-x: hidden;overflow: inherit; }/*
    .layui-table-box {
        overflow: inherit;
    }
    .layui-table-body {
        overflow: inherit;
    }*/
    .layui-table-cell{padding:2px 4px;line-height:20px;}

    th span,.layui-table-cell{white-space:normal;}

</style>
<style>
    .layui-form-label{width: 250px;text-align: left;}
</style>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="clear:both;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>{$ogp_info.ft_group_name}帐单（{$ogp_info.order_count}条）</legend>
        <div class="layui-inline">
            <label class="layui-form-label">总金额：{$ogp_info.sum_price_all}元</label>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">返回计时扣款：{$ogp_info.sum_after_return_price}元</label>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">其它扣款：{$ogp_info.sum_other_cut_payment}元</label>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">实付金额：{$ogp_info.payable}元</label>
            </div>
        </div>
    </fieldset>
    <div class="layui-tab-content">
        <table id="dataTable" lay-filter="demoEvent"></table>
    </div>
</div>



{include file="system@block/layui" /}

<script type="text/html" id="skuTpl">
    <span >{{ d.is_auto_import }}</span> <br>
    <span class="copy-item">{{ d.client_ordernum }}</span> <br>
    <span class="copy-item">{{ d.sku }}</span></br>
    <span >{{ d.ft_name }}/{{ d.ft_group_name }}</span>
</script>
<script type="text/html" id="materialTpl">
    {{# if(d.is_share== 1){ }}
    <a class="layui-btn layui-btn-normal layui-btn-xs layui-bg-orange">共</a>
    {{# } }}
    <span class="copy-item">{{ d.mInfo.name }}</span><br />
    {{d.mInfo.color}}
</script>
<script type="text/html" id="unit">
    {{d.mInfo.unit}}
</script>
<script type="text/html" id="color">
    {{d.mInfo.color}}
</script>
<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('billList')}?stall_feed_id={{d.id}}" class="hisi-iframe blue" hisi-data="{width: '70%', height: '70%'}" title="费用单">帐单明细</a></br>
    <!--    <a href="{:url('stallCost/stallCostDetail')}?stall_feed_id={{d.id}}" title="费用单" class="hisi-iframe blue" hisi-data="{width: '70%', height: '90%'}">查看费用单</a>-->
</script>
<script type="text/html" id="toolbar">
    <div class="layui-btn-group fr">
        <form class="layui-form layui-form-pane fixed-bar-form" action="{:url('',['stall_feed_id' => $stall_feed_id])}" method="get" id="hisi-table-search">
            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm hisi-export">导出</button>
        <form>
            {if ( $ogp_info['status']==1130)  }
        <a data-href="{:url('check')}?status=1130&stall_feed_id={$stall_feed_id}" class="layui-btn layui-btn-primary layui-btn-sm j-page-btns confirm layui-icon fa-back">返已审核</a>&nbsp;&nbsp;
            {else /}
            {if ( $status_type==0)  }
        <a data-href="{:url('check')}?status=1102&type=one" class="layui-btn layui-btn-primary layui-btn-sm j-page-btns confirm layui-icon bo-back">驳回</a>
            {/if}
            {/if}
    </div>
</script>
<script type="text/html" id="detailTpl">
    <a href="{:url('StallBillFeed/stallBillFeedDetail')}?stall_bill_id={{d.id}}" title="明细表" class="hisi-iframe blue" hisi-data="{width: '100%', height: '100%'}">打开</a>
    <!--    <form class="layui-form layui-form-pane fixed-bar-form" action="{:url('StallBillFeed/stallBillFeedDetail')}?stall_bill_id={{d.id}}" method="get" id="hisi-table-search">-->
    <a href="{:url('StallBillFeed/stallBillFeedDetail')}?stall_bill_id={{d.id}}&export=1" style="cursor:pointer;border: none" class="blue hisi-export">下载</a>
    <!--    <form>-->
</script>
<script type="text/html" id="picTpl">
    <span class="lay-pic-container" src="{{ d.pic }}">
		<img src="{{ d.ori_pic }}" class="lay-pic">
	</span>
</script>

<script src="__PUBLIC_JS__/jquery.2.1.4.min.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/xm-select/dist/xm-select.js?v={:config('hisiphp.version')}"></script>
<script type="text/javascript">
    layui.use(['table', 'laydate', 'form', 'laytpl','tool','layer'], function() {
        var $ = layui.jquery;
        var table = layui.table;
        var laydate = layui.laydate;
        var form = layui.form;
        var layer = layui.layer;
        var initialize=0,second_initialize=0,first_init=0,changetab=0;
        laydate.render({
            elem: '#create_date_range'
            ,range: '~'
            ,theme: 'molv'
            ,mark: {'{:$today}':''}
            ,change: function(value, date, endDate){
                $('#create_date_range').val(value);
                $('#layui-laydate1').remove();//关闭面板
            }
        });
        laydate.render({
            elem: '#create_date_range1'
            ,range: '~'
            ,theme: 'molv'
            ,mark: {'{:$today}':''}
            ,change: function(value, date, endDate){
                $('#create_date_range1').val(value);
                $('#layui-laydate2').remove();//关闭面板
            }
        });

        laydate.render({
            elem: '#stall_order_time'
            ,range: '~'
            ,theme: 'molv'
            ,mark: {'{:$today}':''}
            ,change: function(value, date, endDate){
                $('#stall_order_time').val(value);
                $('#layui-laydate3').remove();//关闭面板
            }
        });
        window.status=0;
        window.statCli = function(status) {
            var url='{:url()}?status='+status;
            window.status=status;
            $("#hisi-table-search").attr('action',url);
            $("#seacher").click();
            changetab=1;
        }

        table.render({
            elem: '#dataTable'
            ,url: '{:url("billList", ["stall_feed_id" => $stall_feed_id,"status_real"=>$status_real])}' //数据接口
            ,page: true //开启分页
            //,skin: 'row'
            ,even: true
            ,limit: 20
            ,limits: [20,50,100,150,200]
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: '#toolbar'

            ,defaultToolbar: ['exports', 'print']
            ,cols: [[ //表头
                {type:'checkbox'}
                ,{field:'pic',title : '图片', templet:'#picTpl',width:110}
                //2--18
                ,{field: 'col2', title: '来源/订单号/sku/委外工厂', templet: '#skuTpl' ,width:200}
                ,{field: 'sum_shicai_count', title: '裁床数',width:80}
                ,{field: 'group_out_type_txt', title: '委外类型',width:80}
                ,{field: 'cost_jiagong_littleSumCost', title: 'MES车缝价' ,width:80}
                ,{field: 'cost_jiagong_scale', title: 'MES倍率' ,width:80}
                ,{field: 'mes_cost_res', title: 'MES加工费' ,width:80}
                ,{field: 'dress_changkuan_unitPrice', title: 'MES长款补贴单价' ,width:80}
                // ,{field: 'order_price', title: 'MES加工费'}
                // ,{field: 'cost_little', title: '小计',width:80}


                ,{field: 'unit_num', title: '委外倍率' ,width:80}
                ,{field: 'u_price_manual', title: '手工/专机单价' ,width:80}
                ,{field: 'u_scale_changkuan', title: '长款补贴倍率' ,width:80}
                ,{field: 'order_price_res', title: '委外单价' ,width:80}
                ,{field: 'order_price_res_changkuan', title: '长款补贴单价' ,width:80}
                ,{field: 'caichuang_t_strip_price', title: '捆条金额',width:80}
                ,{field: 'sum_jiaohuo_count', title: '车间总数',width:80}
                ,{field: 'sum_jiaohuo_tail_count', title: '尾部总数',width:80}

                ,{field: 'sum_store_count', title: 'MES入仓总数',width:120}
                ,{field: 'sum_stock_in', title: '米莫入库数',width:80}
                ,{field: 'real_pay_count', title: '实际结算总数',width:80}
                ,{field: 'chayi_num', title: '差异数',width:80}
                ,{field: 'price_all', title: '加工费总金额',width:120}
                ,{field: 'confiscation_num', title: '没收',width:80}
                ,{field: 'after_return_time', title: '工时',width:80}

                ,{field: 'after_return_price', title: '返工金额',width:80}
                ,{field: 'other_cut_payment', title: '其它扣款',width:80}
                ,{field: 'remark', title: '备注',width:80}
                ,{field: 'admin_username', title: '上一操作人'}

                ,{field: 'status_txt', title: '状态',width:80}
                // ,{field: 'col3', title: '操作',templet:'#buttonTpl'}
            ]]
            ,done: function(res, curr, count){
                var data=res.data;
                for (var i in data){
                    $('#stall-ids-'+data[i]['id']).val(data[i]['stall_id']);
                }
                layui.form.render();
            }
        });
    });
</script>